<!DOCTYPE html>
<html>
<head>
    <title></title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showDiv == 1">
        <Row :gutter="16">
            <div class="search-group">
                <i-button @click="query">查询</i-button>
            </div>
            <div class="buttons-group">
                #if($shiro.hasPermission("coupon:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("coupon:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("coupon:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
                <!--#if($shiro.hasPermission("coupon:publish"))-->
                <!--<i-button type="primary" @click="publish">-->
                <!--<Icon type="android-send"></Icon>-->
                <!--</i>&nbsp;发放-->
                <!--</i-button>-->
                <!--#end-->
            </div>
        </Row>
        <table id="jqGrid"></table>
    </div>

    <Card v-show="showDiv == 2">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="coupon" :rules="ruleValidate" :label-width="160">
            <Form-item label="优惠券名称" prop="name">
                <i-input v-model="coupon.name" placeholder="优惠券名称"/>
            </Form-item>

            <Form-item label="状态" prop="status">
                <Radio-group v-model="coupon.status">
                    <Radio label="1">
                        <span>正常</span>
                    </Radio>
                    <Radio label="0">
                        <span>失效</span>
                    </Radio>
                </Radio-group>
            </Form-item>
            <Form-item label="赠送金额" prop="typeMoney">
                <Input-number :min="0" v-model="coupon.typeMoney" placeholder="赠送金额" style="width: 188px;"/>
            </Form-item>
            <Form-item label="订单最小金额" prop="minAmount">
                <Input-number :min="0" v-model="coupon.minAmount" placeholder="订单最小金额" style="width: 188px;"/>
            </Form-item>
            <Form-item label="订单最大金额" prop="maxAmount">
                <Input-number :min="0" v-model="coupon.maxAmount" placeholder="订单最大金额" style="width: 188px;"/>
            </Form-item>
            <Form-item label="最小商品金额" prop="minGoodsAmount">
                <Input-number :min="0" v-model="coupon.minGoodsAmount" placeholder="最小商品金额" style="width: 188px;"/>
            </Form-item>
            <Form-item label="有效期（天）" prop="invalidDays">
                <Input-number :min="1" v-model="coupon.invalidDays" placeholder="领取之后的有效天数" style="width: 188px;"/>
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>
                返回</i-button>
                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
    </Card>

</div>

<script src="${rc.contextPath}/js/shop/coupongrads.js?_${date.systemTime}"></script>
</body>
</html>